
import React, {Component} from 'react';

import {
Alert,
  ScrollView,
  StyleSheet,
  RefreshControl,
  Text,
  TouchableWithoutFeedback,
  View,
  Button
} from 'react-native';

export default class Row extends Component{

  constructor(props) {
    super(props);

    }
  _onClick=()=>{
    this.props.onClick(this.props.data);
  }

  render(){
    return (
        <View style={styles.row}>
         <Button
         onPress={this._onClick}
                title={this.props.data.text + ' (' + this.props.data.clicks + ' clicks)'}
          />
         </View>
    );
  }
}

const styles = StyleSheet.create({
  row: {
    borderColor: 'grey',
    borderWidth: 1,
    padding: 20,
    backgroundColor: '#3a5795',
    margin: 5,
  },
  text: {
    alignSelf: 'center',
    color: '#fff',
  },
  scrollview: {
    flex: 1,
  },
});